/*
 * Create Author  : jinpeng.chen
 * Create Date    : 2016-11-22
 * Project        : spring-boot
 * File Name      : ConditionConfig.java
 *
 * Copyright (c) 2010-2015 by Shanghai HanTao Information Co., Ltd.
 * All rights reserved.
 *
 */
package com.charles.spring.config;

import com.charles.spring.bean.LinuxCondition;
import com.charles.spring.bean.WindowsCondition;
import com.charles.spring.service.LinuxListService;
import com.charles.spring.service.ListService;
import com.charles.spring.service.WindowsListService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * 功能描述:  <p>
 *
 * @author : jinpeng.chen <p>
 * @version 1.0 2016-11-22
 * @since spring-boot 1.0
 */
@Configuration
@ComponentScan("com.charles.spring")
public class ConditionConfig {
    @Bean
    @Conditional(WindowsCondition.class)
    public ListService windowsListService() {
        return new WindowsListService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxListService() {
        return new LinuxListService();
    }
}
